﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Contributor.Data_Objects
{
    public class Contribution
    {
        public int FundContributionId { get; set; }
        public DateTime ContributionDate { get; set; }
        public decimal ContributionAmount { get; set; }
        public string ContributionCode { get; set; }
        public string FundCode { get; set; }


        public static List<Contribution> LoadForEntity(int entityID)
        {
            string cmdStr = string.Format(@" 
SELECT FundContributionId, ContributionDate, ContributionAmount, ContributionCode, FundCode
FROM dbo_FundContribution p
INNER JOIN dbo_Fund f ON f.FundId=p.FundId
WHERE EntityID={0}", entityID);

            return DbSupportLib.Support.QueryToList(new List<Contribution>(), AppConfig.DbConnection, System.Data.CommandType.Text, cmdStr);
        }
    }
}
